/*
 * @(#)Role.java 2009-2-19
 * Copyright (c) 2008-2015 by CJK
 * All rights reserved.
 */
package net.beyond.core.entity;

import java.util.ArrayList;
import java.util.List;

import net.beyond.common.BaseEntity;

/**
 * Ȩ����
 * 
 * @author Shmiluyu
 * @version 1.000 2009-2-19
 */
public class Group extends BaseEntity {

	private static final long serialVersionUID = 1L;
	private String groupName;
	private List<Role> roles;

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public void addRole(Role role) {
		if (getRoles() == null || getRoles().size() <= 0) {
			setRoles(new ArrayList<Role>());
		}
		getRoles().add(role);
	}
}
